.class public Lcom/htc/android/footprints/activity/SettingActivity;
.super Landroid/preference/PreferenceActivity;
.source "SettingActivity.java"


# instance fields
.field private mResetSerialNumber:Landroid/preference/Preference;

.field private mRetrieveAddress:Landroid/preference/CheckBoxPreference;

.field private mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

.field private mSettingDb:Landroid/content/SharedPreferences;

.field private mShowConnectionFailedAlert:Landroid/preference/CheckBoxPreference;

.field private mShowLocationDisabledAlert:Landroid/preference/CheckBoxPreference;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 18
    invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V

    .line 19
    invoke-static {p0}, Lcom/htc/android/footprints/utils/SettingInfo;->getInstance(Landroid/content/Context;)Lcom/htc/android/footprints/utils/SettingInfo;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/activity/SettingActivity;)Landroid/preference/CheckBoxPreference;
    .locals 1
    .parameter "x0"

    .prologue
    .line 18
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mRetrieveAddress:Landroid/preference/CheckBoxPreference;

    return-object v0
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/activity/SettingActivity;)Lcom/htc/android/footprints/utils/SettingInfo;
    .locals 1
    .parameter "x0"

    .prologue
    .line 18
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    return-object v0
.end method

.method static synthetic access$200(Lcom/htc/android/footprints/activity/SettingActivity;)Landroid/content/SharedPreferences;
    .locals 1
    .parameter "x0"

    .prologue
    .line 18
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSettingDb:Landroid/content/SharedPreferences;

    return-object v0
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 2
    .parameter "icicle"

    .prologue
    .line 28
    invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V

    .line 29
    const v0, 0x7f030024

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->setContentView(I)V

    .line 30
    const/high16 v0, 0x7f05

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->addPreferencesFromResource(I)V

    .line 32
    const-string v0, "FootprintsSetting"

    const/4 v1, 0x2

    invoke-virtual {p0, v0, v1}, Lcom/htc/android/footprints/activity/SettingActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSettingDb:Landroid/content/SharedPreferences;

    .line 33
    const-string v0, "pref_retrieve_address"

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mRetrieveAddress:Landroid/preference/CheckBoxPreference;

    .line 34
    const-string v0, "pref_show_location_disabled_alert"

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowLocationDisabledAlert:Landroid/preference/CheckBoxPreference;

    .line 35
    const-string v0, "pref_show_connection_failed_alert"

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowConnectionFailedAlert:Landroid/preference/CheckBoxPreference;

    .line 36
    const-string v0, "pref_serial_number"

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mResetSerialNumber:Landroid/preference/Preference;

    .line 37
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mRetrieveAddress:Landroid/preference/CheckBoxPreference;

    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-boolean v1, v1, Lcom/htc/android/footprints/utils/SettingInfo;->retrieveAddress:Z

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 38
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowLocationDisabledAlert:Landroid/preference/CheckBoxPreference;

    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-boolean v1, v1, Lcom/htc/android/footprints/utils/SettingInfo;->showLocationDisabledAlert:Z

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 39
    iget-object v0, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowConnectionFailedAlert:Landroid/preference/CheckBoxPreference;

    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-boolean v1, v1, Lcom/htc/android/footprints/utils/SettingInfo;->showConnectionFailedAlert:Z

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 40
    return-void
.end method

.method protected onDestroy()V
    .locals 0

    .prologue
    .line 44
    invoke-super {p0}, Landroid/preference/PreferenceActivity;->onDestroy()V

    .line 45
    return-void
.end method

.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
    .locals 6
    .parameter "preferenceScreen"
    .parameter "preference"

    .prologue
    const v5, 0x7f0a0065

    const v4, 0x7f0a0004

    const v3, 0x7f0200ad

    .line 50
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mRetrieveAddress:Landroid/preference/CheckBoxPreference;

    if-ne p2, v1, :cond_2

    .line 52
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mRetrieveAddress:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v1}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 53
    .local v0, checked:Z
    if-eqz v0, :cond_1

    .line 54
    new-instance v1, Lcom/htc/widget/HtcAlertDialog$Builder;

    invoke-direct {v1, p0}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v2, 0x7f0a009a

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/activity/SettingActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setIcon(I)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    const v2, 0x7f0a009b

    invoke-virtual {p0, v2}, Lcom/htc/android/footprints/activity/SettingActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    new-instance v2, Lcom/htc/android/footprints/activity/SettingActivity$2;

    invoke-direct {v2, p0, v0}, Lcom/htc/android/footprints/activity/SettingActivity$2;-><init>(Lcom/htc/android/footprints/activity/SettingActivity;Z)V

    invoke-virtual {v1, v5, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    new-instance v2, Lcom/htc/android/footprints/activity/SettingActivity$1;

    invoke-direct {v2, p0}, Lcom/htc/android/footprints/activity/SettingActivity$1;-><init>(Lcom/htc/android/footprints/activity/SettingActivity;)V

    invoke-virtual {v1, v4, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1}, Lcom/htc/widget/HtcAlertDialog$Builder;->show()Lcom/htc/widget/HtcAlertDialog;

    .line 135
    .end local v0           #checked:Z
    :cond_0
    :goto_0
    const/4 v1, 0x0

    return v1

    .line 74
    .restart local v0       #checked:Z
    :cond_1
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iput-boolean v0, v1, Lcom/htc/android/footprints/utils/SettingInfo;->retrieveAddress:Z

    .line 75
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSettingDb:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    const-string v2, "pref_retrieve_address"

    invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    goto :goto_0

    .line 110
    .end local v0           #checked:Z
    :cond_2
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowLocationDisabledAlert:Landroid/preference/CheckBoxPreference;

    if-ne p2, v1, :cond_3

    .line 111
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-object v2, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowLocationDisabledAlert:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v2

    iput-boolean v2, v1, Lcom/htc/android/footprints/utils/SettingInfo;->showLocationDisabledAlert:Z

    .line 112
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSettingDb:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    const-string v2, "pref_show_location_disabled_alert"

    iget-object v3, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-boolean v3, v3, Lcom/htc/android/footprints/utils/SettingInfo;->showLocationDisabledAlert:Z

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    goto :goto_0

    .line 115
    :cond_3
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowConnectionFailedAlert:Landroid/preference/CheckBoxPreference;

    if-ne p2, v1, :cond_4

    .line 116
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-object v2, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mShowConnectionFailedAlert:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v2

    iput-boolean v2, v1, Lcom/htc/android/footprints/utils/SettingInfo;->showConnectionFailedAlert:Z

    .line 117
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSettingDb:Landroid/content/SharedPreferences;

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    const-string v2, "pref_show_connection_failed_alert"

    iget-object v3, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mSetting:Lcom/htc/android/footprints/utils/SettingInfo;

    iget-boolean v3, v3, Lcom/htc/android/footprints/utils/SettingInfo;->showConnectionFailedAlert:Z

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    goto :goto_0

    .line 121
    :cond_4
    iget-object v1, p0, Lcom/htc/android/footprints/activity/SettingActivity;->mResetSerialNumber:Landroid/preference/Preference;

    if-ne p2, v1, :cond_0

    .line 122
    new-instance v1, Lcom/htc/widget/HtcAlertDialog$Builder;

    invoke-direct {v1, p0}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const v2, 0x7f0a0031

    invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setIcon(I)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    const v2, 0x7f0a0033

    invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setMessage(I)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    new-instance v2, Lcom/htc/android/footprints/activity/SettingActivity$3;

    invoke-direct {v2, p0}, Lcom/htc/android/footprints/activity/SettingActivity$3;-><init>(Lcom/htc/android/footprints/activity/SettingActivity;)V

    invoke-virtual {v1, v5, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v4, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1}, Lcom/htc/widget/HtcAlertDialog$Builder;->show()Lcom/htc/widget/HtcAlertDialog;

    goto/16 :goto_0
.end method
